package com.skypan.myapplication.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

public abstract class BaseFragment extends Fragment {

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

        View view = createView(inflater,container,savedInstanceState);
        com.lidroid.xutils.ViewUtils.inject(this, view);

//        initToolBar();
        init();
        return view;

    }

//    public void  initToolBar(){
//
//    }
    public abstract View createView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState);


    public abstract void init();



//    public void startActivity(Intent intent,boolean isNeedLogin){
//
//
//        if(isNeedLogin){
//
//            User user =CniaoApplication.getInstance().getUser();
//            if(user !=null){
//                super.startActivity(intent);
//            }
//            else{

//                CniaoApplication.getInstance().putIntent(intent);
//                Intent loginIntent = new Intent(getActivity(), LoginActivity.class);
//                super.startActivity(loginIntent);

//            }
//
//        }
//        else{
//            super.startActivity(intent);
//        }
//
//    }


}
